import java.math.*;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        BinaryTree binaryTree = new BinaryTree();
//        TreeNode root = binaryTree.createTree();
//        binaryTree.preOrder(root);
//        System.out.println();
//        System.out.println(binaryTree.size(root));
//        System.out.println(binaryTree.size1(root));
//        System.out.println(binaryTree.getLeafNodeCount(root));
//        System.out.println(binaryTree.getLeafNodeCount1(root));
//        int a = binaryTree.getKLevelSize(root,3);
//        System.out.println(a);
//        System.out.println("高度");
//        System.out.println(binaryTree.getHeight(root));
//        System.out.println("查找是否存在");
//        TreeNode retroot = binaryTree.find(root,'C');
//        System.out.println(retroot.val);
//        System.out.println("查看是否是完全二叉树");
//        System.out.println(binaryTree.isCompleteTree(root));
        String str = scanner.nextLine();  //构建二叉树，以中序遍历输出
        TreeNode root1 = binaryTree.createTree1(str);
//        binaryTree.inorder(root);
        binaryTree.levelOrder(root1);
    }
}
